package chatclient.applets.canvas;




import chatclient.tools.NoteContainer;
import chatclient.applets.ListView;
import java.awt.event.*;

public class ListCanvas extends NoteCanvas
        implements MouseListener, KeyListener {

    public ListCanvas(ListView listview, NoteContainer notecontainer, String s, boolean flag) {
        super(notecontainer, s, flag);
        listener = listview;
        addMouseListener(this);
        addKeyListener(this);
    }

    @Override
    public void mouseClicked(MouseEvent mouseevent) {
        int i = mouseevent.getX();
        int j = mouseevent.getY();
        if (listener != null) {
            int k = findNoteAtPosition(i, j);
            if (listener != null && k >= 0) {
                listener.clickedNote(k, mouseevent.getClickCount());
            }
        }
    }

    @Override
    public void mouseEntered(MouseEvent mouseevent1) {
    }

    @Override
    public void mouseExited(MouseEvent mouseevent1) {
    }

    @Override
    public void mousePressed(MouseEvent mouseevent1) {
    }

    @Override
    public void mouseReleased(MouseEvent mouseevent1) {
    }

    @Override
    public void keyPressed(KeyEvent keyevent1) {
    }

    @Override
    public void keyReleased(KeyEvent keyevent1) {
    }

    @Override
    public void keyTyped(KeyEvent keyevent1) {
    }
    private ListView listener;
}
